package cn.springstudio.springui;

import cn.springstudio.springui.extension.DateTimeActivity;
import cn.springstudio.springui.extension.RecyclerViewActivity;
import cn.springstudio.springui.extension.ScrollViewActivity;
import cn.springstudio.springui.extension.TabActivity;
import cn.springstudio.springui.extension.ViewPagerActivity;
import cn.springstudio.springui.extension.WheelPickerActivity;
import cn.springstudio.springui.template.GridFragment;
import cn.springstudio.springui.template.LayoutDialog;

public class ExtensionFragment extends GridFragment {

    public ExtensionFragment() {
        addAction("DateTime", DateTimeActivity.class);
        addAction("RecyclerView", RecyclerViewActivity.class);
        addAction("ScrollView", ScrollViewActivity.class);
        addAction("Tab", TabActivity.class);
        addAction("ViewPager", ViewPagerActivity.class);
        addAction("WheelPicker", WheelPickerActivity.class);
    }

    public static ExtensionFragment newInstance() {
        return new ExtensionFragment();
    }

    @Override
    public void onItemClicked(int position) {
        super.onItemClicked(position);
        LayoutDialog.newInstance(R.layout.ui_rapid_fab).show(getChildFragmentManager());
    }
}